from google.appengine.ext import db
from google.appengine.ext import search

##################################################################################
#                                                                                #
#                       Models                                                   #
#                                                                                #
##################################################################################

class PR_Project(db.Model):
  projectId = db.IntegerProperty()
  name = db.StringProperty()
  slug = db.StringProperty()
  url = db.StringProperty()
  server = db.StringProperty()
  topics = db.StringListProperty()
  lang = db.StringProperty()
  status = db.StringProperty()
  favicon = db.StringProperty()
  type = db.StringProperty()
  
class PR_Link(db.Model):
  linkId = db.IntegerProperty()
  pubDate = db.DateTimeProperty(auto_now_add=True)
  linker = db.StringProperty()
  linked = db.StringProperty()

class PR_Server(db.Model):
  serverId = db.IntegerProperty()
  name = db.StringProperty()
  slug = db.StringProperty()

class PR_Indexed(db.Model):
  projectId = db.IntegerProperty()
  projectSlug = db.StringProperty()
  date = db.DateTimeProperty(auto_now_add=True)
  pages = db.IntegerProperty()

class PR_PageRank(db.Model):
  projectId = db.IntegerProperty()
  projectSlug = db.StringProperty()
  date = db.DateTimeProperty(auto_now_add=True)
  rank = db.IntegerProperty()

class CustomUser(db.Model):
  name = db.StringProperty()
  user = db.UserProperty()
  role = db.StringProperty()